﻿using ServerSide.EFCoreContext;
using ServerSide.Model;
using ServerSide.Service.Interface;
using AutoMapper;

namespace ServerSide.Service
{
    public class UserLoginService : IUserLoginService
    {
        private readonly MyDBContext _myDBContext;
        private readonly IMapper _mapper;
        public UserLoginService(MyDBContext myDBContext,IMapper mapper) {
            _myDBContext = myDBContext;
            _mapper = mapper;
        }

        //判断PersonInfo是否完整
        public bool JudgingPersonalInfo(User user)
        {
            //判断个人信息，如果有一个为null则返回false
            if (string.IsNullOrEmpty(user.Email) || string.IsNullOrEmpty(user.HeadPhotoPath) ||
                string.IsNullOrEmpty(user.Phone) || string.IsNullOrEmpty(user.Gender.ToString()) ||
                string.IsNullOrEmpty(user.Birthday.ToString()))
            {
                return false;
            }
            return true;
        }
        

    }

}
